home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / cb / list.c < prev    next >
C/C++ Source or Header  |  1996-07-19  |  689b  |  45 lines

  1.  
  2. #include "cb.h"
  3.  
  4. void list()
  5. {
  6.     char
  7.         *who = gargv[2];
  8.  
  9.     register int
  10.         uid;
  11.         
  12.     need_cbmode();
  13.  
  14.     showdestinations();
  15.     showextra();
  16.     showdirect();
  17.  
  18.     if (who)
  19.     {
  20.     if ((uid = lookuser(who)) <= lastuser())  /* specific user requested */
  21.         listdestinations(uid, givephonenumbers());
  22.     else
  23.         error("No info about %s", who);
  24.     }
  25.     else
  26.     {
  27.     printf
  28.     (
  29.         "\n"
  30.         "Default tty-line:\n"
  31.         "-----------------\n"
  32.         "%s\n"
  33.         "\n"
  34.         "Callback users:\n"
  35.         "---------------\n",
  36.         get_ttyline(0)
  37.     );
  38.  
  39.     for (uid = 0; uid <= lastuser(); uid++)
  40.         listdestinations(uid, 1);        /* list the destinations */
  41.     }
  42.  
  43.     putchar('\n');
  44. }
  45.